package hy.service.impl;

import com.alibaba.dubbo.config.annotation.Reference;
import entity.UserAddress;
import hy.service.OrderService;
import org.springframework.stereotype.Service;
import service.UserService;

@Service//spring注解
public class OrderServiceImpl implements OrderService {
    //@Reference//产生代理类的对象放入容器中，并注入
    //@Reference(timeout=3000,version="*")
    //@Reference(stub = "hy.service.impl.US_stub")
    //@Reference(url = "192.168.1.161:20880")
    @Reference(timeout=3000)
    UserService service;
    @Override
    public UserAddress initOrder(String id) {
        UserAddress addr=service.getUserAddress(id);
        System.out.println("id为"+id+"的用户地址为："+addr);
        return addr;
    }
}